VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Health_Care 
   BackColor       =   &H8000000A&
   Caption         =   "Health Care"
   ClientHeight    =   9390
   ClientLeft      =   165
   ClientTop       =   555
   ClientWidth     =   15240
   LinkTopic       =   "Form1"
   ScaleHeight     =   9390
   ScaleWidth      =   15240
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command5 
      Caption         =   "&Close"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   13320
      TabIndex        =   25
      Top             =   6480
      Width           =   1815
   End
   Begin VB.Frame Date 
      BackColor       =   &H8000000A&
      Caption         =   "Date"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   13320
      TabIndex        =   19
      Top             =   360
      Width           =   1455
      Begin VB.TextBox Dt 
         Height          =   375
         Left            =   240
         TabIndex        =   20
         Top             =   480
         Width           =   975
      End
   End
   Begin VB.CommandButton Command4 
      BackColor       =   &H80000013&
      Caption         =   "&Delete"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   11280
      TabIndex        =   17
      Top             =   6480
      Width           =   1815
   End
   Begin VB.CommandButton Command3 
      BackColor       =   &H80000013&
      Caption         =   "&Edit"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   9240
      TabIndex        =   16
      Top             =   6480
      Width           =   1815
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H80000013&
      Caption         =   "&Save"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   7200
      TabIndex        =   15
      Top             =   6480
      Width           =   1815
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H80000013&
      Caption         =   "Se&arch"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   5280
      TabIndex        =   14
      Top             =   6480
      Width           =   1695
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H8000000A&
      Caption         =   "Recommendation"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   4815
      Left            =   7920
      TabIndex        =   12
      Top             =   360
      Width           =   4935
      Begin VB.TextBox recom 
         Height          =   3975
         Left            =   360
         TabIndex        =   13
         Top             =   480
         Width           =   4215
      End
   End
   Begin VB.Frame Frame3 
      BackColor       =   &H8000000A&
      Caption         =   "Diagnosis"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1455
      Left            =   240
      TabIndex        =   3
      Top             =   5520
      Width           =   4335
      Begin VB.ComboBox med 
         Height          =   315
         ItemData        =   "Patient.frx":0000
         Left            =   1560
         List            =   "Patient.frx":0019
         TabIndex        =   9
         Text            =   "*Select One*"
         Top             =   840
         Width           =   2295
      End
      Begin VB.ComboBox ail 
         Height          =   315
         ItemData        =   "Patient.frx":0061
         Left            =   1560
         List            =   "Patient.frx":007A
         TabIndex        =   8
         Text            =   "*Select One*"
         Top             =   360
         Width           =   2295
      End
      Begin VB.Label Label6 
         BackColor       =   &H8000000A&
         Caption         =   "Medication:"
         Height          =   255
         Left            =   360
         TabIndex        =   10
         Top             =   840
         Width           =   975
      End
      Begin VB.Label Label5 
         BackColor       =   &H8000000A&
         Caption         =   "Ailment:"
         Height          =   255
         Left            =   360
         TabIndex        =   7
         Top             =   360
         Width           =   1695
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H8000000A&
      Caption         =   "Patient's Information"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   5055
      Left            =   240
      TabIndex        =   1
      Top             =   240
      Width           =   7215
      Begin VB.TextBox PV 
         Height          =   375
         Left            =   4080
         TabIndex        =   31
         Top             =   4200
         Width           =   2055
      End
      Begin VB.TextBox TC 
         Height          =   375
         Left            =   1800
         TabIndex        =   29
         Top             =   4200
         Width           =   1935
      End
      Begin VB.TextBox ST 
         Height          =   375
         Left            =   3120
         TabIndex        =   26
         Top             =   3120
         Width           =   2895
      End
      Begin VB.TextBox MN 
         Height          =   375
         Left            =   1800
         TabIndex        =   22
         Top             =   1680
         Width           =   4815
      End
      Begin VB.TextBox FN 
         Height          =   375
         Left            =   1800
         TabIndex        =   21
         Top             =   1080
         Width           =   4815
      End
      Begin VB.TextBox Age 
         Height          =   405
         Left            =   1800
         TabIndex        =   6
         Top             =   2400
         Width           =   4815
      End
      Begin VB.TextBox HN 
         Height          =   375
         Left            =   1800
         TabIndex        =   4
         Top             =   3120
         Width           =   975
      End
      Begin VB.TextBox LN 
         Height          =   375
         Left            =   1800
         TabIndex        =   2
         Top             =   480
         Width           =   4815
      End
      Begin VB.Label Label8 
         BackColor       =   &H8000000A&
         Caption         =   "Province"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4080
         TabIndex        =   32
         Top             =   4680
         Width           =   1815
      End
      Begin VB.Label Label3 
         BackColor       =   &H8000000A&
         Caption         =   "Town/City"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1800
         TabIndex        =   30
         Top             =   4680
         Width           =   1455
      End
      Begin VB.Label text 
         BackColor       =   &H8000000A&
         Caption         =   "House #"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1800
         TabIndex        =   28
         Top             =   3600
         Width           =   735
      End
      Begin VB.Label Label2 
         BackColor       =   &H8000000A&
         Caption         =   "Street Name and Baranggay (separated by a comma)"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   3120
         TabIndex        =   27
         Top             =   3600
         Width           =   2775
      End
      Begin VB.Label Label1 
         BackColor       =   &H8000000A&
         Caption         =   "Middle Name:"
         Height          =   375
         Left            =   480
         TabIndex        =   24
         Top             =   1680
         Width           =   615
      End
      Begin VB.Label Fs 
         BackColor       =   &H8000000A&
         Caption         =   "First Name:"
         Height          =   375
         Left            =   480
         TabIndex        =   23
         Top             =   1080
         Width           =   615
      End
      Begin VB.Label Name 
         BackColor       =   &H8000000A&
         Caption         =   "Last Name:"
         Height          =   375
         Left            =   480
         TabIndex        =   18
         Top             =   480
         Width           =   615
      End
      Begin VB.Label Label7 
         BackColor       =   &H8000000A&
         Caption         =   "Age:"
         Height          =   375
         Left            =   480
         TabIndex        =   11
         Top             =   2400
         Width           =   855
      End
      Begin VB.Label Label4 
         BackColor       =   &H8000000A&
         Caption         =   "Address:"
         Height          =   495
         Left            =   480
         TabIndex        =   5
         Top             =   3120
         Width           =   855
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   495
      Left            =   240
      Top             =   7080
      Width           =   2295
      _ExtentX        =   4048
      _ExtentY        =   873
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483637
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   $"Patient.frx":00C5
      OLEDBString     =   $"Patient.frx":0151
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "patient"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Courier"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "Patient.frx":01DD
      Height          =   1455
      Left            =   240
      TabIndex        =   0
      Top             =   7800
      Width           =   14895
      _ExtentX        =   26273
      _ExtentY        =   2566
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   18
      AllowAddNew     =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Comic Sans MS"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "Health_Care"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If LN.text = "" Then
MsgBox "Please type the last name of the entry you want to search!", vbInformation, "Thank You"
LN.SetFocus
Else
found = False
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
If LN.text = Adodc1.Recordset!PLName Then
found = True
Exit Do
End If
Adodc1.Recordset.MoveNext
Loop
If found = True Then
MsgBox "Record Found!", vbInformation, "Message"
LN.text = Adodc1.Recordset!PLName
FN.text = Adodc1.Recordset!PFName
MN.text = Adodc1.Recordset!PMName
HN.text = Adodc1.Recordset!HouseNum
ST.text = Adodc1.Recordset!Street_Baranggay
TC.text = Adodc1.Recordset!TownOrCity
PV.text = Adodc1.Recordset!Province
Age.text = Adodc1.Recordset!Age
ail.text = Adodc1.Recordset!Illness
med.text = Adodc1.Recordset!Medicine
recom.text = Adodc1.Recordset!Recommendation
Dt.text = Adodc1.Recordset!Date
Else
MsgBox "Record not found!", vbCritical, "Sorry"
LN.text = ""
FN.text = ""
MN.text = ""
Age.text = ""
HN.text = ""
ST.text = ""
TC.text = ""
PV.text = ""
recom.text = ""
Dt.text = ""
ail.text = "*Select One*"
med.text = "*Select One*"
LN.SetFocus
End If
End If
End Sub

Private Sub Command2_Click()
If LN.text = "" And FN.text = "" And MN.text = "" And Age = "" And HN.text = "" And ST.text = "" And TC.text = "" And PV.text = "" And ail.text = "*Select One*" And med.text = "*Select One*" And recom.text = "" And Dt.text = "" Then
MsgBox "Sorry! Please fill up all the required field.", vbCritical, "Sorry"
    If LN.text = "" Then
    LN.SetFocus
    ElseIf FN.text = "" Then
    FN.SetFocus
    ElseIf MN.text = "" Then
    MN.SetFocus
    ElseIf Age.text = "" Then
    Age.SetFocus
    ElseIf HN.text = "" Then
    HN.SetFocus
    ElseIf ST.text = "" Then
    ST.SetFocus
    ElseIf TC.text = "" Then
    TC.SetFocus
    ElseIf PV.text = "" Then
    PV.SetFocus
    ElseIf recom.text = "" Then
    recom.SetFocus
    ElseIf ail.text = "" Then
    ail.SetFocus
    ElseIf med.text = "" Then
    med.SetFocus
    ElseIf Dt.text = "" Then
    Dt.SetFocus
    End If
Else
    Adodc1.Recordset.AddNew
    If Adodc1.Recordset.EOF = False Then
    Adodc1.Recordset!PLName = LN.text
    Adodc1.Recordset!PFName = FN.text
    Adodc1.Recordset!PMName = MN.text
    Adodc1.Recordset!HouseNum = HN.text
    Adodc1.Recordset!Street_Baranggay = ST.text
    Adodc1.Recordset!TownOrCity = TC.text
    Adodc1.Recordset!Province = PV.text
    Adodc1.Recordset!Age = Age.text
    Adodc1.Recordset!Illness = ail.text
    Adodc1.Recordset!Medicine = med.text
    Adodc1.Recordset!Recommendation = recom.text
    Adodc1.Recordset!Date = Dt.text
    MsgBox "Record Saved"
    LN.text = ""
    FN.text = ""
    MN.text = ""
    Age.text = ""
    HN.text = ""
    ST.text = ""
    TC.text = ""
    PV.text = ""
    recom.text = ""
    ail.text = "*Select One*"
    med.text = "*Select One*"
    Dt.text = ""
    End If
End If
End Sub

Private Sub Command3_Click()
If LN.text = "" Then
MsgBox "Search the last name of the entry you want to edit.", vbCritical, "Message"
Else
    LN.SetFocus
    If Adodc1.Recordset.EOF = False Then
    Adodc1.Recordset!PLName = LN.text
    Adodc1.Recordset!PFName = FN.text
    Adodc1.Recordset!PMName = MN.text
    Adodc1.Recordset!HouseNum = HN.text
    Adodc1.Recordset!Street_Baranggay = ST.text
    Adodc1.Recordset!TownOrCity = TC.text
    Adodc1.Recordset!Province = PV.text
    Adodc1.Recordset!Age = Age.text
    Adodc1.Recordset!Illness = ail.text
    Adodc1.Recordset!Medicine = med.text
    Adodc1.Recordset!Recommendation = recom.text
    Adodc1.Recordset!Date = Dt.text
    Adodc1.Recordset.Update
    MsgBox "Record has been updated", vbInformation, "Message"
    LN.text = ""
    FN.text = ""
    MN.text = ""
    Age.text = ""
    HN.text = ""
    ST.text = ""
    TC.text = ""
    PV.text = ""
    recom.text = ""
    Dt.text = ""
    ail.text = "*Select One*"
    med.text = "*Select One*"
    LN.SetFocus
    End If
End If
End Sub

Private Sub Command4_Click()
If LN.text = "" Then
MsgBox "Type last name of the entry you want to delete!", vbInformation, "Message"
LN.SetFocus
Else
    found = False
    Adodc1.Recordset.MoveFirst
    Do While Not Adodc1.Recordset.EOF
        If LN.text = Adodc1.Recordset!PLName Then
        found = True
        Exit Do
        End If
    Adodc1.Recordset.MoveNext
    Loop
        If found = True Then
        MsgBox "Record found", vbInformation, "Message"
        LN.text = Adodc1.Recordset!PLName
        FN.text = Adodc1.Recordset!PFName
        MN.text = Adodc1.Recordset!PMName
        HN.text = Adodc1.Recordset!HouseNum
        ST.text = Adodc1.Recordset!Street_Baranggay
        TC.text = Adodc1.Recordset!TownOrCity
        PV.text = Adodc1.Recordset!Province
        Age.text = Adodc1.Recordset!Age
        ail.text = Adodc1.Recordset!Illness
        med.text = Adodc1.Recordset!Medicine
        recom.text = Adodc1.Recordset!Recommendation
        Dt.text = Adodc1.Recordset!Date
            If MsgBox("Do you really want to delete the selected file?", vbYesNo) = vbYes Then
            Adodc1.Recordset.Delete
                If Adodc1.Recordset.EOF = False Then
                Adodc1.Recordset.Update
                MsgBox "File has been deleted", vbInformation, "Message"
                LN.text = ""
                FN.text = ""
                MN.text = ""
                Age.text = ""
                HN.text = ""
                ST.text = ""
                TC.text = ""
                PV.text = ""
                recom.text = ""
                Dt.text = ""
                ail.text = "*Select One*"
                med.text = "*Select One*"
                    If MsgBox("Do you want to delete another record?", vbYesNo) = vbYes Then
                    MsgBox "Type the last name of the entry you want to delete.", vbInformation, "Message"
                    LN.SetFocus
                    End If
                End If
            End If
        Else
        MsgBox "Record not found.", vbCritical, "Sorry"
        LN.text = ""
        FN.text = ""
        MN.text = ""
        Age.text = ""
        HN.text = ""
        ST.text = ""
        TC.text = ""
        PV.text = ""
        recom.text = ""
        Dt.text = ""
        ail.text = "*Select One*"
        med.text = "*Select One*"
        LN.SetFocus
        End If
    End If
        
End Sub

Private Sub Command5_Click()
End
End Sub

